﻿using MaterialDesignThemes.Wpf;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace UpperComputer.WPF.Entry.Common
{
    /// <summary>
    /// ConfirmDialogControl.xaml 的交互逻辑
    /// </summary>
    public partial class MessageControl : UserControl
    {
        public MessageControl(string text, MessageBoxImage icon)
        {
            InitializeComponent();
            MessageLabel.Text = text;
            switch (icon)
            {
                case MessageBoxImage.Information:
                default:
                    MessageIcon.Kind = PackIconKind.Information;
                    break;
                case MessageBoxImage.Warning:
                    MessageIcon.Kind = PackIconKind.Warning;
                    MessageIcon.Foreground = new SolidColorBrush(Colors.Yellow);
                    break;
                case MessageBoxImage.Error:
                    MessageIcon.Kind = PackIconKind.Error;
                    MessageIcon.Foreground = new SolidColorBrush(Colors.Red);
                    break;
                case MessageBoxImage.Question:
                    MessageIcon.Kind = PackIconKind.HelpCircle;
                    break;
            }
        }
    }
}
